package com.wetool.model;

import java.sql.Date;
import java.util.Calendar;

import javax.persistence.Column;

import org.springframework.util.StringUtils;

import com.wetool.entity.Shop;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@Data
@ApiModel(description = "查询参数对象")
public class SearchParam {
	
	@ApiModelProperty(value = "店铺名称", required = false)  
	private String name;
	
	@ApiModelProperty(value = "查询关键字", required = false)  
	private String key;	// 查询关键字
	
	@ApiModelProperty(value = "商家ID", required = false)  
	private Long merchantId;	//商家ID
	
	@ApiModelProperty(value = "开始日期", required = false)  
	private Date from;
	
	@ApiModelProperty(value = "结束日期", required = false)  
	private Date to;
	
	@ApiModelProperty(value = "状态值", required = false)  
	private Integer status;	
	
	@ApiModelProperty(value = "地区编号", required = false)  
	private String areaId;	
	
	@ApiModelProperty(hidden=true)
	private Boolean isDeleted;	// 是否删除 0-否 1-是
	
	@ApiModelProperty(value = "服务商ID", required = false)  
    private Long spId;
	
	@ApiModelProperty(value = "移动支付状态0:未进件1:已进件2:已开通", required = false) 
	private Integer mobilePayment ;
	
	@ApiModelProperty(value = "经度" , required = false)
	private Double longitude ;
	
	@ApiModelProperty(value = "纬度" , required = false)
	private Double latitude;
	
	private Double gelongitude;
	private Double gelongitude() {
		return this.gelongitude = gelongitude - 1 ;
	}
	private Double lelongitude;
	private Double lelongitude() {
		return this.lelongitude = lelongitude + 1 ;
	}
	private Double gelatitude;
	private Double gelatitude() {
		return this.gelatitude = gelatitude - 1 ;
	}
	private Double lelatitude;
	private Double lelatitude() {
		return this.lelatitude = lelatitude + 1 ;
	}
	public java.util.Date getTo() {
		if (StringUtils.isEmpty(this.to)) {
			return null;
		}
		Calendar startDT = Calendar.getInstance();  
        startDT.setTime(this.to);  
        startDT.add(Calendar.DAY_OF_MONTH, 1);  
        return startDT.getTime();
	}
	
}